//
//  NSError+BSNetWork.m
//  BSOrange
//
//  Created by kenshin on 14-8-4.
//  Copyright (c) 2014年 BazzarEntertainment. All rights reserved.
//

#import "NSError+BSNetWork.h"

NSString * const BSErrorDomain = @"BSErrorDomain";
NSInteger const BSErrorNotLogin = 100101;

@implementation NSError (BSNetWork)

+ (NSError *)bsErrorWithErrorCode:(NSInteger)code userInfo:(NSDictionary *)info
{
    return [NSError errorWithDomain:BSErrorDomain code:code userInfo:info];
}

+ (NSError *)bsNotLoginError
{
    NSDictionary *info = @{NSLocalizedDescriptionKey: @"未登录"};
    return [self bsErrorWithErrorCode:BSErrorNotLogin userInfo:info];
}

+ (NSError *)bsErrorWithMessage:(NSString *)message code:(NSInteger)code
{
    NSDictionary *info = @{NSLocalizedDescriptionKey: message};
    return [self bsErrorWithErrorCode:code userInfo:info];
}


@end
